package com.lt.lumentracks.service;

import com.lt.lumentracks.entity.po.ChatMessage;
import com.baomidou.mybatisplus.extension.service.IService;
import com.lt.lumentracks.entity.vo.common.PageVO;
import com.lt.lumentracks.entity.vo.common.Result;

import java.util.List;

/**
 * <p>
 * 聊天消息表 服务类
 * </p>
 *
 * @author swl
 * @since 2025-10-06
 */
public interface IChatMessageService extends IService<ChatMessage> {

    // 根据会话id分页查询
    PageVO<ChatMessage> getByPage(Long conversationId, long pageNum, long pageSize);

    // 撤回消息
    Result<String> revokeMsg(Long id);

    // 批量查询每个会话的最后一条消息
    List<ChatMessage> queryLastMessageByConversationIds(List<Long> conversationIds);
}
